<template>
  <div class="lever2">
    <div class="hd">
      <span class="name">人气新品</span>
      <p class="desc">人气新品</p>
    </div>
    <List />
  </div>
</template>

<script setup>

import { ref, onMounted, defineProps, inject } from 'vue';
import List from "./List.vue"
import axios from 'axios'
const props = defineProps({
  isShowList: {
    type: Boolean,
    default: true
  },
})


// const tableData = ref([])
// async function loadList() {
//   const { data } = await axios.get('http://localhost:3001/whole')
//   tableData.value = data

// }

// onMounted(() => {
//   loadList()
//   // console.log(tableData);
// })
</script>

<style lang="less" scoped>
.lever2 {
  padding-top: 30px;

  .hd {
    text-align: center;
    line-height: 1;
    margin-bottom: 40px;

    .name {
      font-size: 24px;
      font-weight: 700;
      line-height: 44px;
    }

    .desc {
      font-size: 14px;
      color: #999;
      line-height: 1.5;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }
}

.itemList {
  margin-top: 25px;
  display: flex;
  flex-wrap: wrap;

  li:hover {
    background-color: #f4f0ea;
    box-shadow: 2px 2px 2px rgba(0, 0, 0, .2);
  }

  .goods {
    width: 245px;
    height: 401px;
    margin-right: 10px;
    box-sizing: border-box;
    margin-bottom: 15px;

    .image {
      width: 245px;
      height: 245px;
      background-color: pink;
    }

    .bd {
      padding-bottom: 20px;

      .name {
        width: 166px;
        margin: 0 auto 4px;
        text-align: center;
        max-height: 40px;
        line-height: 20px;
        // display: -webkit-box;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      .geli {
        height: 20px;
        font-size: 0;
        color: #fff;
        width: 200px;
        margin: 0 auto 3px;
        overflow: hidden;
      }

      .price {
        margin: 0;
        padding: 0;
        color: #d4282d;
        text-align: center;

        span {
          display: inline-block;
          overflow: hidden;
          height: 20px;
          line-height: 22px;
        }

        .zhe {
          margin-left: 6px;
          font-size: 12px;
          color: #999;
          text-decoration: line-through;
        }



      }

      hr {
        display: block;
        width: 130px;
        height: 1px;
        padding: 0;
        margin: 6px auto 14px;
        border: 0;
        border-top: 1px solid #e8e8e8;
      }

      .descbox {
        width: 200px;

        .desc {
          padding-left: 18px;
          width: 100%;
          text-align: center;
          line-height: 18px;
          color: #999;
          font-size: 13px;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }
      }

      .buttonbox {
        margin-top: 10px;
        display: flex;
        justify-content: center;

        .button {
          color: #fff;
        }
      }
    }
  }
}
</style>
